package sparrowGui
{
	import flash.display.DisplayObjectContainer;
	
	/**
	 * 点击弹出列表提示窗
	 * @author Pelephone
	 */
	public class PopupListTip extends PopupTip
	{
		// 点弹出的列表
		private var _list:VList;
		
		public function PopupListTip(parent:DisplayObjectContainer, vars:Object=null, listVars:Object=null)
		{
			_list = new VList([],null,listVars);
			super(parent, vars);
		}
		
		override protected function init():void
		{
			addChild(_list);
			this.visible = false;
			_list.style.bgColor = 0;
			if(!style.height)
				_list.style.autoHeight = true;
			if(!style.width)
				_list.style.autoWidth = true;
		}
		
		override public function update(data:Object):void
		{
			_list.update(data);
			super.update(data);
		}
		
		override public function set width(w:Number):void
		{
			super.width = w;
			_list.width = w;
		}
		
		override public function get width():Number
		{
			return style.width || _list.width || 100;
		}
		
		override public function set height(h:Number):void
		{
			super.height = h;
			_list.height = h;
		}
		
		override public function get height():Number
		{
			return _list.panHeight;
		}
	}
}